import Vue from 'vue'
import Home from "@/views/Home"
import Search from "@/views/Search"
import NotFound from "@/views/NotFound"


import VueRouter from 'vue-router'
Vue.use(VueRouter)
const router = new VueRouter({
  routes: [ 
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home }, 
    // name属性表示 给路由规则起了一个名字 ，可以通过name进行跳转
    { path: '/search', component: Search, name: 'search' }, 
    { path: '*', component: NotFound }
  ]
})

export default router